﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for CCEmployemntDB
/// </summary>
/// 
namespace CE.CreditCard
{
    public class CCEmploymentDB
    {
        public CCEmploymentDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(CCEmployment ccemployment)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocCCApplicantEmploymentInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            _sPara.Add("@CCEmpId", ccemployment.CCEmpId);
            _sPara.Add("@CCPersonnelId", ccemployment.CCPersonnelId);
            _sPara.Add("@CCCARId", ccemployment.CCARId);
            _sPara.Add("@CCOccupation", ccemployment.CCEmpOccupation);
            _sPara.Add("@CCIndBusType", ccemployment.CCIndBusiType);
            _sPara.Add("@CCEmpBusName", ccemployment.CCEmpBusiName);
            _sPara.Add("@CCEmpBusNature", ccemployment.CCEmpBusiNature);
            _sPara.Add("@CCPosition", ccemployment.CCPosition);
            _sPara.Add("@CCServiceYears", ccemployment.CCServiceYears);
            _sPara.Add("@CCServiceMonths", ccemployment.CCServiceMonths);
            _sPara.Add("@CCEmpUnitNo", ccemployment.CCEmpUnitNo);
            _sPara.Add("@CCEmpHomeNo", ccemployment.CCEmpHomeNo);
            _sPara.Add("@CCEmpStreetName", ccemployment.CCEmpStreetName);
            _sPara.Add("@CCEmpCountry", ccemployment.CCEmpCountry);
            _sPara.Add("@CCEmpPostalCode", ccemployment.CCEmpPostalCode);
            _sPara.Add("@CCAnualIncome", ccemployment.CCAnualIncome);
            _sPara.Add("@CCOtherIncome", ccemployment.CCOtherIncome == true ? 1 : 0);
            _sPara.Add("@CCOtherIncomeAmount", ccemployment.CCOtherIncomeAmt);
            _sPara.Add("@CCOtherIncomeSource", ccemployment.CCOtherIncomeSource);
            _sPara.Add("@RefCEUserId", ccemployment.RefCEUserId);
            _sPara.Add("@ViewedDetailId", ccemployment.ViewedDetailId);

            _sPara.Add("@Status", ccemployment.CCStatus == true ? 1 : 0);
            _sPara.Add("@Info1", ccemployment.CCInfo1);
            _sPara.Add("@Info2", ccemployment.CCInfo2);
            _sPara.Add("@Info3", ccemployment.CCInfo3);
            _sPara.Add("@Info4", ccemployment.CCInfo4);
            _sPara.Add("@Info5", ccemployment.CCInfo5);

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }
    }
}